Skip to content

Replace jest with node:test - #213

Merged
joakimen merged 3 commits into
masterfrom
chore/replace-jest-cdk-snapshot
Sep 2, 2026
Merged

joakimen merged 3 commits into
masterfrom
chore/replace-jest-cdk-snapshot

Conversation

@joakimen

@joakimen joakimen commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Swaps the jest ecosystem for the built-in node:test runner, and takes @liflig/cdk-snapshot from the registry now that it is published.

Snapshot bodies are unchanged — only the jest file header is dropped.

Fix

Relative imports in src were extensionless, so tsc emitted them unchanged into lib.

Node's ESM resolver requires full specifiers, so the published package only loaded for consumers running it through a bundler.

rewriteRelativeImportExtensions now rewrites the extensions on emit.

This surfaced because ts-jest resolved the extensionless imports and Node's own resolver does not.

Removed

jest, @types/jest and ts-jest, along with their config.

tsx, since Node strips types natively.

@aws-cdk/assert, which was unused and deprecated.

Snapshots are unchanged: the new library produces byte-identical output, so
the existing .snap files still match without regeneration.
Relative imports in src were extensionless, so tsc emitted them unchanged
into lib. Node's ESM resolver requires full specifiers, meaning the
published package only loaded for consumers running it through a bundler;
a plain Node ESM import failed with ERR_MODULE_NOT_FOUND. Source imports
now carry .ts extensions, and rewriteRelativeImportExtensions rewrites
them to .js on emit.

This also unblocks running the tests directly on the sources. ts-jest
resolved the extensionless imports, so the breakage was invisible until
the test runner started using Node's own resolver.

Replace jest with node:test and take @liflig/cdk-snapshot from the
registry. Snapshot bodies are unchanged; only the jest file header is
dropped. Drops the unused @aws-cdk/assert and tsx along with the jest
toolchain, since Node strips types natively.
@joakimen
joakimen merged commit fe6eefc into master Sep 2, 2026
2 checks passed
@joakimen
joakimen deleted the chore/replace-jest-cdk-snapshot branch September 2, 2026 12:17
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.5.161 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant